package com.sinosoft.vaccinetoai.common.configure;

import com.sinosoft.vaccinetoai.utils.IdUtils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 配置
 * @author xzh
 * @date 2022-10-24 14:38
 * @since 5.0.0
 */
@Configuration
@EnableConfigurationProperties({

})
public class CommonConfig {

    @Value("${app.config.worker.workerId:}")
    private Long workerId;


    @PostConstruct
    public void init() throws Exception {
        if(null == workerId) workerId = 1L;
        /**
         * 初始化
         */
        IdUtils.init(workerId);
    }

}
